/*
 * Copyright (c) 2019, Alliance for Open Media. All rights reserved
 *
 * This source code is subject to the terms of the BSD 2 Clause License and
 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
 * was not distributed with this source code in the LICENSE file, you can
 * obtain it at www.aomedia.org/license/software. If the Alliance for Open
 * Media Patent License 1.0 was not distributed with this source code in the
 * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
 */

#ifndef AOM_AV1_COMMON_INTRA_ENTROPY_MODELS_H_
#define AOM_AV1_COMMON_INTRA_ENTROPY_MODELS_H_

#include "config/aom_config.h"

#include "av1/common/enums.h"
#include "av1/common/nn_em.h"

#include "aom_ports/mem.h"

#if CONFIG_INTRA_ENTROPY
// Models
static const float intra_y_mode_lr = CONFIG_USE_SMALL_MODEL ? 0.1f : 0.0001f;
static const float intra_uv_mode_lr = 0.2f;

#define EM_Y_OUTPUT_SIZE (INTRA_MODES)
#define EM_UV_OUTPUT_SIZE (UV_INTRA_MODES)

#define EM_NUM_UV_SPARSE_FEATURES (2)
#define EM_UV_SPARSE_FEAT_SIZE_0 (INTRA_MODES + 1)
#define EM_UV_SPARSE_FEAT_SIZE_1 (1 + 1)
#define EM_UV_DENSE_FEATURES (0)

#if CONFIG_USE_SMALL_MODEL
#define EM_NUM_Y_SPARSE_FEATURES (2)
#define EM_Y_SPARSE_FEAT_SIZE_0 (INTRA_MODES + 1)
#define EM_Y_SPARSE_FEAT_SIZE_1 (INTRA_MODES + 1)
#define EM_NUM_Y_DENSE_FEATURES (0)
#else
#define EM_NUM_Y_SPARSE_FEATURES (0)
#define EM_Y_SPARSE_FEAT_SIZE_0 (0)
#define EM_Y_SPARSE_FEAT_SIZE_1 (0)
#define EM_NUM_Y_DENSE_FEATURES (72)
#endif  // CONFIG_USE_SMALL_MODEL

#if CONFIG_USE_SMALL_MODEL
static const float
    intra_y_mode_input_layer_sparse_0_weights[EM_Y_SPARSE_FEAT_SIZE_0 *
                                              EM_Y_OUTPUT_SIZE] = {
      0.137246f,  -0.68192f,  -0.449793f, -0.753694f, -0.766231f, -0.747245f,
      -0.645688f, -0.556105f, -0.599176f, -0.322966f, -0.486145f, -0.347526f,
      -0.737309f, -0.325971f, 0.742491f,  -1.577678f, -1.364718f, -1.188326f,
      -0.476676f, -1.807612f, -1.329216f, -0.345656f, -0.706906f, -0.149576f,
      -1.394987f, -0.045029f, 0.048399f,  -1.327275f, 0.409363f,  -1.490153f,
      -1.315845f, -1.608056f, -0.545012f, -0.454561f, -1.371244f, -0.521266f,
      -0.924556f, -0.465445f, -0.557146f, -0.430759f, -1.506279f, -1.315071f,
      0.485384f,  -1.307871f, -1.291626f, -1.331205f, -0.221682f, -0.112816f,
      -0.425926f, -0.770425f, -0.812377f, -1.749586f, -0.348252f, -1.641402f,
      -1.413799f, -1.724442f, 1.059568f,  -0.013322f, -0.083676f, -0.955923f,
      -1.478377f, -0.971938f, -1.155238f, -1.072362f, -1.957214f, -0.38096f,
      -0.434495f, -1.463698f, -1.37623f,  0.171549f,  0.893986f,  -1.036923f,
      -0.989849f, -0.854843f, -0.736449f, -0.605564f, -1.215255f, -1.397086f,
      -0.314998f, -1.721539f, -0.523842f, -1.482171f, -0.280575f, -0.955947f,
      0.549903f,  -0.681085f, -1.26304f,  -0.753293f, -1.275464f, -0.731523f,
      -1.936478f, -0.18089f,  -1.454707f, -0.640187f, -0.0275f,   -1.104447f,
      -0.961503f, -0.675787f, 0.452446f,  -0.626612f, -0.275946f, -0.774834f,
      -0.323021f, -1.706445f, -0.437649f, -0.680268f, -1.533183f, -0.131497f,
      -1.07561f,  -0.831982f, -1.475937f, -0.758885f, 0.756776f,  -0.390186f,
      -0.432915f, -0.956475f, -1.373394f, -0.22781f,  -0.855182f, -0.570893f,
      -0.565895f, -0.817844f, -0.803137f, -0.867268f, -0.379268f, -0.433796f,
      -0.016458f, -0.370261f, -0.310656f, -0.844661f, -0.141855f, -0.537906f,
      -0.731369f, -0.822225f, -1.120068f, -0.636214f, -1.131715f, -0.557966f,
      -0.446843f, -0.438417f, -0.283601f, -0.888653f, -0.932307f, -0.121158f,
      -1.218242f, -0.455927f, -0.694698f, -1.101539f, -1.09111f,  -0.824071f,
      -0.292303f, -0.768001f, -0.335891f, -0.71028f,  -0.40518f,  -0.93111f,
      -0.406899f, -0.110261f, -0.272158f, -1.286608f, -1.486353f, -1.186606f,
      -1.347047f, -1.011894f, -0.89116f,  -0.750328f, -0.638965f, -0.82986f,
      0.439974f,  0.0f,       0.0f,       0.0f,       0.0f,       0.0f,
      0.0f,       0.0f,       0.0f,       0.0f,       0.0f,       0.0f,
      0.0f,       0.0f,
    };

static const float
    intra_y_mode_input_layer_sparse_1_weights[EM_Y_SPARSE_FEAT_SIZE_1 *
                                              EM_Y_OUTPUT_SIZE] = {
      0.131244f,  -0.444973f, -0.337025f, -0.867933f, -0.937149f, -0.722192f,
      -0.727418f, -0.436252f, -0.7835f,   -0.356551f, -0.682492f, -0.482595f,
      -0.699017f, 0.02678f,   0.324141f,  -1.084225f, -1.462219f, -1.504717f,
      -0.722098f, -1.701789f, -1.241779f, -0.672173f, -0.640758f, -0.575179f,
      -1.417869f, -0.353974f, -0.405696f, -1.583565f, 1.052646f,  -1.853595f,
      -1.87065f,  -2.006352f, -0.956762f, -0.698274f, -1.768856f, -0.91357f,
      -1.506205f, -0.597492f, -0.406335f, -0.221275f, -1.101f,    -1.256514f,
      0.198775f,  -1.59001f,  -1.363469f, -1.323609f, -0.069754f, -0.438966f,
      -0.379441f, -0.814756f, -0.704217f, -1.610939f, -0.207408f, -0.828844f,
      -1.407361f, -1.177041f, 0.792062f,  0.04937f,   -0.240598f, -1.301413f,
      -0.884043f, -0.723704f, -0.957809f, -1.423163f, -1.57676f,  -0.207727f,
      -0.3593f,   -1.28678f,  -1.123993f, -0.397716f, 0.703334f,  -0.922242f,
      -1.316663f, -0.624908f, -0.580959f, -0.849181f, -1.33456f,  -1.691544f,
      -0.093193f, -1.14147f,  -0.329729f, -1.347752f, -0.009984f, -0.855214f,
      0.877591f,  -0.784076f, -1.012489f, -0.660211f, -1.272253f, -0.795443f,
      -1.381189f, -0.178046f, -1.22841f,  -0.347587f, -0.409463f, -1.385864f,
      -1.160053f, -0.749161f, 0.635121f,  -0.984732f, -0.352338f, -1.037923f,
      -0.539009f, -1.523903f, 0.011383f,  -0.489265f, -1.122096f, -0.305579f,
      -1.110911f, -0.802949f, -1.186678f, -0.710623f, 0.354585f,  -0.264055f,
      -0.484788f, -0.72145f,  -1.223436f, -0.097682f, -0.465241f, -0.542619f,
      -0.703123f, -1.081214f, -0.758759f, -0.903677f, -0.311573f, -0.617676f,
      0.029494f,  -0.550892f, -0.492647f, -0.82547f,  -0.111344f, -0.687377f,
      -0.768571f, -1.071038f, -1.171732f, -0.754636f, -1.25038f,  -0.911045f,
      -0.778023f, -0.508076f, -0.388334f, -1.198759f, -0.692516f, -0.057743f,
      -0.76195f,  -0.135534f, -0.822606f, -1.324705f, -1.064078f, -0.78194f,
      -0.395862f, -0.910187f, -0.295955f, -0.842958f, -0.473995f, -1.126621f,
      -0.285227f, -0.175399f, 0.142178f,  -1.289266f, -1.491758f, -0.989101f,
      -1.448516f, -0.925204f, -0.878481f, -0.666946f, -0.619417f, -0.967644f,
      0.651129f,  0.0f,       0.0f,       0.0f,       0.0f,       0.0f,
      0.0f,       0.0f,       0.0f,       0.0f,       0.0f,       0.0f,
      0.0f,       0.0f,
    };

static const float
    *const intra_y_mode_input_layer_sparse_weights[EM_NUM_Y_SPARSE_FEATURES] = {
      intra_y_mode_input_layer_sparse_0_weights,
      intra_y_mode_input_layer_sparse_1_weights
    };

static const float
    intra_y_mode_input_layer_dense_weights[EM_NUM_Y_DENSE_FEATURES] = {};

static const float intra_y_mode_input_layer_bias[EM_Y_OUTPUT_SIZE] = {
  0.727235f,  -0.124064f, -0.226174f, -0.369686f, -0.723211f,
  -0.621841f, -0.690408f, -0.453834f, -0.506766f, 0.095593f,
  -0.590127f, -0.270232f, -1.008363f,
};

static const int intra_y_sparse_feat_sizes[EM_NUM_Y_SPARSE_FEATURES] = {
  EM_Y_SPARSE_FEAT_SIZE_0, EM_Y_SPARSE_FEAT_SIZE_1
};
#else
static const float *const
    intra_y_mode_input_layer_sparse_weights[EM_NUM_Y_SPARSE_FEATURES] = {};

static const float
    intra_y_mode_input_layer_dense_weights[EM_NUM_Y_DENSE_FEATURES *
                                           EM_Y_OUTPUT_SIZE] = {
      0.049660f,  0.142786f,  -0.004678f, 0.134224f,  0.058202f,  -0.010564f,
      -0.069801f, 0.044887f,  0.142680f,  -0.004624f, 0.033854f,  0.142982f,
      0.197994f,  -0.047308f, 0.025474f,  0.092573f,  0.119723f,  0.272275f,
      0.153641f,  0.611267f,  0.675167f,  0.724309f,  0.357242f,  0.459819f,
      0.191545f,  0.230659f,  0.160584f,  0.106318f,  0.265396f,  0.052899f,
      0.029089f,  0.159393f,  0.154847f,  0.258274f,  0.103043f,  0.155835f,
      0.192988f,  -0.000126f, 0.027201f,  0.076033f,  0.265769f,  0.431170f,
      0.356862f,  0.585814f,  0.499349f,  0.676303f,  0.182778f,  0.461210f,
      -0.109539f, 0.026441f,  0.022635f,  0.032858f,  -0.101196f, -0.354005f,
      -0.209535f, -0.111841f, -0.034884f, -0.123497f, -0.070193f, -0.012161f,
      0.007015f,  -0.071403f, 0.062284f,  0.079869f,  0.394670f,  0.466291f,
      0.302191f,  0.363605f,  0.360095f,  0.489215f,  0.297412f,  0.482090f,
      0.205743f,  -0.068991f, 0.517725f,  -0.006257f, -0.171232f, -0.559598f,
      -0.233743f, -0.392528f, -0.149567f, -0.111502f, -0.209995f, 0.048649f,
      -0.230658f, 0.044018f,  0.170561f,  0.013875f,  -0.726654f, 0.332156f,
      1.517396f,  0.405863f,  -0.900619f, -1.420806f, -0.968384f, -1.419882f,
      0.008585f,  -0.024607f, 0.144461f,  -0.320240f, -0.229916f, -0.221994f,
      -0.209796f, -0.304041f, -0.062165f, -0.211440f, -0.092158f, -0.146797f,
      -0.269401f, 0.084031f,  0.044014f,  0.095622f,  -0.197001f, 0.352196f,
      1.212891f,  0.857339f,  0.025120f,  -0.883889f, -1.070539f, -0.821443f,
      -0.127028f, -0.129651f, -0.220950f, 0.249360f,  -0.268799f, -0.367281f,
      -0.272550f, -0.181379f, -0.064097f, -0.262344f, -0.207563f, -0.239414f,
      -0.092767f, -0.056816f, 0.069713f,  0.035035f,  0.192706f,  0.047971f,
      0.213678f,  0.430564f,  -0.069973f, -0.381193f, 0.312239f,  -0.064827f,
      -0.226319f, -0.094217f, -0.272296f, 0.153501f,  -0.352102f, -0.555517f,
      -0.403558f, -0.289666f, -0.311251f, -0.392626f, -0.136820f, -0.146313f,
      -0.128355f, 0.005812f,  -0.024325f, 0.128613f,  -0.398652f, -0.886468f,
      -0.952848f, -0.839160f, -0.152422f, 0.723564f,  1.074703f,  0.153897f,
      0.279606f,  0.005218f,  -0.097104f, 0.637224f,  -0.144649f, -0.604809f,
      -0.353103f, -0.149670f, 0.080755f,  -0.162062f, -0.075633f, -0.152160f,
      0.129778f,  0.118422f,  0.116762f,  0.037845f,  -0.745763f, -0.928273f,
      -0.698849f, -1.057116f, -1.057109f, -0.127244f, 1.462124f,  -0.134539f,
      -0.232858f, -0.143835f, 0.209998f,  -0.080389f, -0.175758f, -0.585471f,
      -0.274928f, -0.280907f, -0.273137f, -0.073505f, -0.210966f, 0.001316f,
      -0.143989f, 0.064993f,  0.120875f,  0.035231f,  0.143145f,  0.092058f,
      0.351673f,  -0.278807f, -0.339373f, 0.254404f,  0.265899f,  0.043099f,
      0.393326f,  0.101095f,  0.015195f,  -0.076545f, 0.446067f,  -0.243100f,
      -0.083523f, -0.256656f, 0.075819f,  0.292427f,  0.205285f,  0.167406f,
      0.232246f,  -0.171207f, 0.111335f,  0.050237f,  1.679853f,  0.406432f,
      -1.406579f, -1.969444f, -2.126589f, -1.850679f, -1.303879f, 1.054393f,
      -0.474468f, -0.240933f, -0.294443f, -0.371815f, 0.104297f,  -0.220134f,
      -0.316479f, -0.376429f, -0.259840f, -0.170570f, -0.079693f, -0.178509f,
      -0.188283f, -0.262617f, 0.086995f,  0.102999f,  1.187274f,  0.522106f,
      -0.806148f, -0.833173f, -0.709481f, -0.953746f, -1.285358f, 0.285016f,
      0.278096f,  0.124818f,  0.163748f,  0.162124f,  -0.007265f, -0.098871f,
      0.072759f,  -0.072074f, 0.124944f,  -0.024829f, 0.102811f,  0.023228f,
      0.146625f,  0.182478f,  -0.028206f, 0.080828f,  -0.208756f, -0.323181f,
      -0.206568f, -0.383950f, -0.390778f, -0.538341f, -0.348925f, -0.129977f,
      0.227470f,  -0.086785f, -0.351658f, -0.380919f, -0.111618f, 1.036530f,
      0.445590f,  0.377118f,  -0.009796f, -0.129295f, -0.195076f, -0.246043f,
      -0.245131f, -0.334228f, 0.004555f,  0.038105f,  -0.738845f, -0.652971f,
      -0.627552f, 0.733840f,  1.239622f,  0.620689f,  -0.694646f, -1.164160f,
      0.043088f,  -0.100113f, -0.268193f, -0.557951f, -0.306883f, 0.989839f,
      0.248173f,  0.521246f,  -0.115040f, -0.280831f, -0.244435f, -0.191424f,
      -0.377725f, -0.546122f, 0.066304f,  0.049083f,  -0.662545f, -0.652138f,
      -0.578238f, 0.051879f,  1.152715f,  1.091766f,  -0.754960f, -0.815882f,
      0.530927f,  0.097425f,  0.040465f,  -0.074201f, 0.128492f,  0.863531f,
      0.316509f,  0.516579f,  0.248138f,  0.137322f,  -0.082366f, -0.069227f,
      -0.136988f, 0.014702f,  0.141653f,  0.047931f,  -0.372670f, -0.109910f,
      -0.450930f, 0.100929f,  0.431826f,  0.263629f,  -0.529284f, -0.566138f,
      -0.020838f, -0.147415f, -0.025617f, -0.297902f, -0.051517f, 0.320145f,
      0.764300f,  -0.030500f, 0.169791f,  -0.092855f, -0.130052f, -0.074605f,
      -0.146200f, -0.326624f, 0.149420f,  -0.016553f, -0.866074f, -0.412905f,
      0.065311f,  1.621385f,  0.697307f,  -0.543428f, -0.812255f, -1.184932f,
      0.198178f,  -0.005435f, -0.149055f, -0.423156f, -0.151902f, 0.386925f,
      0.686412f,  0.030753f,  0.120826f,  -0.000350f, -0.051030f, -0.018974f,
      -0.287549f, -0.191716f, -0.001033f, 0.074794f,  -0.595430f, -0.222999f,
      -0.103303f, 1.241877f,  1.437467f,  -0.061344f, -1.265876f, -1.232849f,
      0.437245f,  0.088420f,  0.024546f,  0.145778f,  0.095337f,  0.269236f,
      0.575351f,  0.207654f,  0.332718f,  0.148132f,  0.027909f,  0.068634f,
      0.060142f,  0.070797f,  0.108747f,  0.057409f,  -0.255563f, -0.042280f,
      -0.229848f, 0.637369f,  0.404043f,  -0.516529f, -0.550570f, -0.672994f,
      0.125899f,  -0.055070f, -0.306667f, -0.175576f, -0.254946f, 0.387511f,
      -0.084208f, 0.724572f,  0.043883f,  -0.201603f, -0.184356f, -0.298600f,
      -0.068762f, -0.344306f, -0.015211f, 0.094913f,  -0.670309f, -1.302545f,
      -1.210474f, -0.696739f, 0.826621f,  1.712139f,  0.036635f,  -0.289428f,
      -0.136242f, -0.145283f, -0.306571f, -0.245688f, -0.230807f, 0.154209f,
      -0.113051f, 0.696596f,  -0.084854f, -0.273326f, -0.272158f, -0.369800f,
      -0.219487f, -0.504060f, 0.085947f,  0.059731f,  -0.742379f, -0.795820f,
      -0.860816f, -0.871319f, 0.118657f,  1.577701f,  0.054237f,  -0.354653f,
      0.191244f,  -0.044441f, 0.017169f,  -0.139851f, -0.046166f, 0.085279f,
      -0.037798f, 0.577405f,  0.007546f,  0.137830f,  -0.198877f, -0.162689f,
      -0.070646f, -0.221147f, 0.101791f,  0.065451f,  -0.315433f, -0.423350f,
      -0.586537f, -0.734971f, -0.189350f, 0.762708f,  -0.087508f, -0.196121f,
      -0.487058f, -0.184812f, -0.276446f, -0.214372f, -0.428919f, -0.234832f,
      -0.214491f, -0.194949f, 0.039145f,  -0.320336f, -0.098930f, -0.119578f,
      -0.080009f, -0.246949f, 0.080498f,  0.108403f,  0.355724f,  -0.737416f,
      -1.154065f, -0.930956f, -0.591217f, -0.485986f, -0.149913f, 1.415765f,
      0.441066f,  0.173153f,  0.174390f,  0.215108f,  0.115941f,  -0.070819f,
      0.182846f,  0.029849f,  0.581264f,  0.088840f,  0.267916f,  0.195155f,
      0.287085f,  0.021049f,  0.140925f,  0.017466f,  0.763483f,  -0.591215f,
      -1.069135f, -1.596326f, -1.806185f, -1.313579f, -0.279576f, 1.932106f,
      0.136550f,  0.065190f,  0.207955f,  -0.015783f, 0.114555f,  -0.100269f,
      0.029467f,  0.045531f,  0.073877f,  0.170323f,  0.047058f,  0.061573f,
      0.059300f,  0.058915f,  0.031465f,  0.064269f,  -0.125848f, -0.458425f,
      -0.003867f, -0.599760f, -0.367709f, -0.403792f, -0.133114f, 0.176069f,
      0.482757f,  0.124613f,  0.249314f,  0.033182f,  0.210524f,  -0.147388f,
      0.080020f,  -0.029364f, 0.111947f,  0.519599f,  0.262428f,  0.326010f,
      0.177949f,  0.014852f,  0.224281f,  -0.033733f, 0.909222f,  1.990240f,
      -0.343764f, -1.363328f, -1.688738f, -1.647148f, -1.347836f, -0.765935f,
      -0.331029f, -0.155846f, -0.066498f, -0.368260f, -0.152498f, -0.287524f,
      0.029627f,  -0.172123f, -0.198702f, 0.172487f,  -0.050933f, -0.093994f,
      -0.192741f, -0.191230f, 0.100004f,  0.066914f,  0.475491f,  1.168132f,
      -0.120350f, -0.106380f, -0.269643f, -0.859525f, -1.283074f, -0.775568f,
      0.397343f,  0.198370f,  0.138501f,  0.221219f,  0.157756f,  0.076851f,
      0.242244f,  0.172206f,  0.292298f,  0.112471f,  0.183792f,  0.149265f,
      0.207444f,  0.170895f,  -0.002324f, 0.062940f,  -0.091032f, -0.091778f,
      -0.110987f, -0.262904f, -0.328377f, -0.496691f, -0.110160f, -0.354372f,
      0.178700f,  0.120829f,  -0.038974f, 0.034229f,  0.157607f,  -0.295649f,
      -0.183355f, -0.175027f, 0.120546f,  0.101038f,  0.344038f,  0.102203f,
      0.199156f,  -0.074120f, 0.033352f,  0.063641f,  0.040677f,  0.165038f,
      -0.244456f, 0.152012f,  0.284913f,  0.189482f,  -0.000482f, 0.233412f,
      0.077767f,  0.087900f,  -0.034471f, -0.117235f, 0.203990f,  -0.361618f,
      -0.138147f, -0.226014f, 0.008826f,  0.149351f,  0.293689f,  0.065580f,
      0.004904f,  -0.150751f, 0.026138f,  0.073536f,  0.127600f,  0.219736f,
      -0.064003f, 0.170668f,  0.346150f,  0.210638f,  -0.192229f, 0.306155f,
      0.178450f,  0.151241f,  0.065534f,  0.084944f,  0.087841f,  -0.348577f,
      -0.074863f, -0.106990f, 0.105447f,  0.084874f,  0.287286f,  0.128779f,
      0.164190f,  0.049853f,  0.061443f,  0.077535f,  -0.016368f, 0.074669f,
      -0.002479f, 0.122399f,  0.249084f,  0.133972f,  -0.037150f, 0.161502f,
      -0.082292f, 0.012521f,  0.054693f,  -0.142222f, -0.178189f, -0.464736f,
      -0.242903f, -0.430408f, -0.174641f, -0.158475f, -0.002931f, 0.093298f,
      -0.170268f, -0.082234f, 0.120454f,  0.044243f,  0.079839f,  0.413193f,
      0.315539f,  0.000644f,  -0.344496f, -0.723777f, -0.312210f, -0.526289f,
      0.006957f,  0.120839f,  -0.066017f, -0.242252f, 0.036611f,  -0.339880f,
      -0.255470f, -0.302869f, -0.050931f, 0.043986f,  0.149838f,  0.276965f,
      -0.130643f, -0.008625f, 0.071336f,  0.063666f,  0.185376f,  0.526826f,
      0.168239f,  0.183330f,  -0.094586f, -0.472802f, -0.532069f, -0.543257f,
      0.081177f,  0.027188f,  0.011658f,  0.140311f,  -0.101814f, -0.332901f,
      -0.141115f, -0.166876f, -0.007094f, -0.085822f, 0.088226f,  0.147281f,
      0.107361f,  0.080092f,  0.067725f,  0.071273f,  0.057040f,  0.064972f,
      0.103215f,  0.016703f,  -0.119816f, -0.434601f, -0.198447f, -0.392944f,
      -0.001456f, 0.087138f,  -0.321563f, 0.003846f,  -0.207387f, -0.484777f,
      -0.349446f, -0.258899f, -0.088622f, -0.193563f, 0.141655f,  -0.104437f,
      0.269378f,  -0.074531f, 0.040217f,  0.098127f,  -0.082863f, -0.533736f,
      -0.815104f, -0.567957f, -0.315266f, 0.181755f,  0.053005f,  0.649585f,
      -0.117664f, 0.022613f,  -0.155621f, 0.056202f,  -0.079148f, -0.465817f,
      -0.208122f, -0.227124f, -0.138529f, -0.060783f, 0.021117f,  -0.136845f,
      0.127099f,  -0.192445f, 0.075326f,  0.084135f,  -0.053343f, -0.470214f,
      -0.665771f, -0.737004f, -0.583433f, -0.134130f, 0.202714f,  0.514613f,
      0.009335f,  0.040189f,  -0.010968f, 0.002114f,  -0.146824f, -0.501031f,
      -0.250585f, -0.168778f, -0.077594f, -0.057846f, 0.029672f,  -0.066808f,
      0.156647f,  -0.045807f, 0.083933f,  0.075743f,  -0.173608f, -0.296816f,
      -0.325823f, -0.341098f, -0.353745f, 0.035926f,  -0.024484f, 0.204774f,
      0.094283f,  0.066495f,  0.090238f,  0.112852f,  -0.381019f, -0.702150f,
      -0.593049f, -0.660785f, -0.547299f, -0.230760f, 0.058931f,  -0.047210f,
      0.063740f,  0.765911f,  0.189107f,  -0.050683f, -0.524195f, -0.821673f,
      1.333656f,  -0.686424f, -0.780920f, -1.436110f, 0.358378f,  -1.282101f,
      -0.207176f, -0.045816f, 0.165468f,  -0.088309f, -0.397622f, -0.845797f,
      -0.823530f, -0.778826f, -0.650956f, -0.297606f, -0.098250f, 0.104483f,
      -0.389836f, 0.733417f,  0.238711f,  -0.076981f, -0.691276f, -0.979101f,
      0.649889f,  -0.982323f, -0.789317f, -0.950209f, 1.083194f,  -1.435849f,
      -0.158885f, -0.125529f, 0.062196f,  0.106598f,  -0.228854f, -0.427222f,
      -0.270075f, -0.363222f, -0.245462f, -0.106370f, -0.077772f, -0.032590f,
      -0.048948f, 0.163287f,  0.045204f,  0.055506f,  0.316608f,  -0.183046f,
      0.229959f,  -0.410276f, -0.169249f, -0.593926f, 0.351192f,  -0.214626f,
    };

static const float intra_y_mode_input_layer_bias[EM_Y_OUTPUT_SIZE] = {
  0.402680f,  0.299231f,  0.291603f,  -0.383439f, -0.325819f,
  -0.284812f, -0.232927f, -0.195319f, -0.268998f, 0.052971f,
  -0.109909f, -0.130525f, 0.105389f,
};

static const float intra_y_sparse_feat_sizes[EM_NUM_Y_SPARSE_FEATURES] = {};
#endif  // CONFIG_USE_SMALL_MODEL

static const float
    intra_uv_mode_input_layer_sparse_0_weights[EM_UV_SPARSE_FEAT_SIZE_0 *
                                               EM_UV_OUTPUT_SIZE] = {
      -0.022437f, -1.476337f, -1.079305f, -1.369786f, -0.990266f, -1.856212f,
      -0.650349f, -0.903463f, -1.999366f, 0.01822f,   -0.175065f, -0.512718f,
      -0.704489f, -0.326674f, -1.244586f, 1.053453f,  -2.231605f, -1.792577f,
      -1.937105f, -1.490042f, -2.499374f, -2.266386f, -0.834529f, -0.89056f,
      -1.410221f, -0.466116f, -1.411492f, -0.764442f, -1.522855f, -2.979386f,
      1.03537f,   -2.700009f, -2.502903f, -3.039665f, -1.885906f, -0.593148f,
      -2.988349f, -1.028047f, -0.293516f, -2.365741f, -1.370096f, -0.564302f,
      -0.296993f, -1.606389f, -1.785203f, 0.583574f,  -1.282405f, -1.574128f,
      -1.548484f, -0.69831f,  -0.422616f, -0.342823f, -0.869744f, -0.731755f,
      -1.189903f, -0.215678f, -0.476821f, -1.811687f, -1.924051f, -1.527432f,
      1.299456f,  -0.720041f, -0.321427f, -1.3067f,   -1.817323f, -0.713401f,
      -1.277511f, -1.025905f, -1.946825f, -0.522943f, -1.283499f, -1.705516f,
      -2.466647f, -1.952012f, -1.014175f, 0.764158f,  -2.122888f, -1.841792f,
      -1.577423f, -0.757386f, -1.645721f, -1.315458f, -1.925307f, -1.049327f,
      -0.547331f, -2.429685f, -0.806005f, -2.151966f, -0.321742f, -2.321216f,
      0.854339f,  -1.986742f, -2.31545f,  -0.782386f, -1.251938f, -1.033313f,
      -1.550866f, -0.334038f, -0.686833f, -2.616098f, -1.888103f, -0.380716f,
      -2.298821f, -2.398352f, -2.238494f, 0.611406f,  -1.972716f, -1.085011f,
      -0.995794f, -1.746689f, -1.444439f, -0.448605f, -1.067342f, -1.33502f,
      -2.457748f, -0.414513f, -1.951028f, -1.902283f, -2.292281f, -1.70929f,
      1.090255f,  -0.574987f, -0.937238f, -1.251462f, -1.506008f, -0.686173f,
      -0.543531f, -2.108663f, -1.409976f, -1.417643f, -1.947594f, -2.389101f,
      -2.165919f, -0.726104f, -1.799072f, -0.074554f, -0.762278f, -0.790384f,
      -1.471953f, -0.637084f, -0.454716f, -0.922157f, -1.646065f, -0.890648f,
      -1.496112f, -1.016747f, -2.123072f, -0.589859f, -0.963129f, -0.103883f,
      0.172081f,  -0.804588f, -0.798625f, -0.730016f, -0.668778f, -2.271251f,
      -0.860099f, -1.297723f, -2.008492f, -2.0302f,   -1.671698f, -0.777974f,
      -1.510594f, -0.131523f, -1.117636f, -0.169876f, -1.067253f, -0.563132f,
      -1.135282f, -1.354549f, -1.368669f, -1.746081f, -1.98956f,  -2.239832f,
      -2.126522f, -1.669555f, -1.703222f, -1.391617f, -1.087187f, -0.656258f,
      1.368177f,  -1.295342f, 0.0f,       0.0f,       0.0f,       0.0f,
      0.0f,       0.0f,       0.0f,       0.0f,       0.0f,       0.0f,
      0.0f,       0.0f,       0.0f,       0.0f,
    };

static const float
    intra_uv_mode_input_layer_sparse_1_weights[EM_UV_SPARSE_FEAT_SIZE_1 *
                                               EM_UV_OUTPUT_SIZE] = {
      0.250092f,  -0.707907f, -0.507987f, -0.885675f, -0.753767f, -0.743063f,
      -0.908853f, -0.815155f, -0.855914f, -0.225903f, -0.901401f, -1.016057f,
      -0.646555f, -0.155239f, 0.0f,       0.0f,       0.0f,       0.0f,
      0.0f,       0.0f,       0.0f,       0.0f,       0.0f,       0.0f,
      0.0f,       0.0f,       0.0f,       0.0f,
    };

static const float *const
    intra_uv_mode_input_layer_sparse_weights[EM_NUM_UV_SPARSE_FEATURES] = {
      intra_uv_mode_input_layer_sparse_0_weights,
      intra_uv_mode_input_layer_sparse_1_weights
    };

static const float
    *const intra_uv_mode_input_layer_dense_weights[EM_UV_DENSE_FEATURES] = {};

static const float intra_uv_mode_input_layer_bias[EM_UV_OUTPUT_SIZE] = {
  0.400602f,  -0.710274f, -0.529749f, -0.923791f, -0.788781f,
  -0.761325f, -0.931022f, -0.852190f, -0.878639f, -0.238912f,
  -0.947551f, -0.974834f, -0.667166f, -0.214130f,
};

static const int intra_uv_sparse_feat_sizes[EM_NUM_UV_SPARSE_FEATURES] = {
  EM_UV_SPARSE_FEAT_SIZE_0, EM_UV_SPARSE_FEAT_SIZE_1
};
#endif  // CONFIG_INTRA_ENTROPY
#endif  // AOM_AV1_COMMON_INTRA_ENTROPY_MODELS_H_
